import {
    init,
    classModule,
    propsModule,
    styleModule,
    eventListenersModule,
    h,
} from "snabbdom";

const patch = init([
    // Init patch function with chosen modules
    classModule, // makes it easy to toggle classes
    propsModule, // for setting properties on DOM elements
    styleModule, // handles styling on elements with support for animations
    eventListenersModule, // attaches event listeners
]);

const example2 = document.getElementById("example-02");

let vnode = h("ul#container.two.classes", { }, [
    h("li", "tom"),
    h("li", "jack"),
    h("li", "lucy")
]);


let oldVnode = patch(example2, vnode)

vnode = h("ul#container.two.classes", { on: {click: clickFn} }, [
    h("li", "tom"),
    h("li", "lucy"),
    h("li", "jack")
]);

oldVnode = patch(oldVnode, vnode)

function clickFn() {
    console.log(111)
}
  